<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>元素的层级</title>
    <style>
        body{
            font-size: 30px;
        }
        .box1{
            width: 100px;
            height: 100px;
            background-color: #bfa;
            position: absolute;
            z-index: 5;
        }
        .box2{
            width: 100px;
            height: 100px;
            background-color:rgba(255,0,0,.3);
            position: absolute;
            top: 50px;
            left: 50px;
        }
        .box3{
            width: 100px;
            height: 100px;
            background-color: green;
            position: absolute;
            top: 100px;
            left: 100px;
            z-index: 4;
        }
        .box4{
            width: 50px;
            height: 50px;
            background-color: orange;
            position: absolute;
        }
    </style>
</head>
<body>
    <div class="box1">1</div>
    <div class="box2">2</div>
    <div class="box3">3
        <div class="box4">4</div>
    </div>
</body>
</html>